<!Doctype>
<head>
	<script>
		NodeList.prototype.getSelectedItem = function(){
			if(!(this && this.length>0 && (this[0].type=='radio' || this[0].type=='checkbox') )){
				return;
			}
			if(this[0].type=='radio'){
				for(i=0; i<this.length; i++){
					if (this[i].checked==true){
						return this[i];
					}
				}
			}
			else if(this[0].type=='checkbox'){
				var arr = new Array;
				for(i=0; i<this.length; i++){
					if (this[i].checked==true){
						arr.push(this[i]);
					}
				}
				return arr;
			}
		}
		function getValue(){
			//alert(document.getElementById('xya').innerHTML);
			alert(document.tv.station.getSelectedItem().value);
		}
	</script>
	</head>
<body>
	<form name='tv'>
		<div id='xya'>			
			NBC: <input type="radio" name="station" value='NBC'><br>
			CBS: <input type="radio" name="station" value='CBS:'><br>
			ABC: <input type="radio" name="station" value='ABC:'><br>
			CNN: <input type="radio" name="station" value='CNN:'><br>
			ESPN:<input type="radio" name="station" value='ESPN:'><br>
		</div><br/>
		<input type='button' onclick='getValue();'value='getValue' />
	</form>
</body>